package com.yd.sdk.ad;

import android.app.Activity;
import com.unity3d.player.UnityPlayer;
import com.yd.sdk.IUnityActivityLifecycleEvents;

public abstract class AdAbstractClass implements IAd,IAdListener, IUnityActivityLifecycleEvents {

    protected Activity activity;
    private static final String GAMEOBJECT = "SDKManagers/AdManager";
    @Override
    public void OnAdSucessToLoad(IAd.AdType type) {
        UnityPlayer.UnitySendMessage(GAMEOBJECT,"OnAdSucessToLoad",type.toString());
    }

    @Override
    public void OnAdFailedToLoad(IAd.AdType type, String message) {
        UnityPlayer.UnitySendMessage(GAMEOBJECT,"OnAdFailedToLoad",type.toString()+":" + message);
    }

    @Override
    public void OnAdOpened(IAd.AdType type) {
        UnityPlayer.UnitySendMessage(GAMEOBJECT,"OnAdOpened",type.toString());
    }

    @Override
    public void OnAdClosed(IAd.AdType type, String reward) {
        UnityPlayer.UnitySendMessage(GAMEOBJECT,"OnAdClosed",type.toString()+":"+reward);
    }

}
